<template>
  <el-dialog :visible.sync="visible" v-dialogDrag title="查看冲突" class="tl-dialog" width="650px" @open="open" @close="close" :append-to-body="true" :modal-append-to-body="true">
    <div style="padding-bottom:10px">
      <div>
        <!--表格渲染-->
        <el-table class="tl-table" ref="mainTable" height="350px" v-loading="loading" :data="dataList" border fit>
          <el-table-column prop="userNameConflict" label="日程人员" min-width="80px" align="center" header-align="center"></el-table-column>
          <el-table-column prop="beginTime" label="开始时间" width="140px" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
          <el-table-column prop="endTime" label="结束时间" width="140px" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
          <el-table-column prop="scheduleName" label="日程标题" :show-overflow-tooltip="true" min-width="150px" align="left" header-align="center"></el-table-column>
        </el-table>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="text" @click="doCancelEdit" size="mini">取消</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_list } from '@tapui/mixins/mixin_list'
/** 子组件 */
/** 工具类 */
import { queryDataCode } from '@tapui/api/dataCode'
import { getAction, putAction, postAction, deleteAction } from '@tapui/utils/http'
import { formatDate } from '@tapui/utils/date'
/** VUE配置 */
export default {
  name: 'TlWorkScheduleRef',
  mixins: [mixin_list],
  data() {
    return {
      // 参照是否显示
      visible: false,
      tableHeight: '400px',
      isQueryOnCreated: false
    }
  },
  props: {
    dataList: {
      type: Array,
      default: function() {
        return []
      }
    }
  },
  methods: {
    /** 打开对话框 */
    open() {},
    /** 取消 */
    doCancelEdit() {
      this.visible = false
    },
    /** 格式化日期 yyyy-MM-dd HH:mm:ss */
    dateTimeFormat(row, column, cellValue, index) {
      let dateValue = row[column.property]
      if (dateValue && dateValue.length > 0) {
        return formatDate(new Date(dateValue.replace(new RegExp(/-/gm), '/')), 'yyyy-MM-dd HH:mm')
      } else {
        return ''
      }
    },
    /** 页面关闭时执行 */
    close() {}
  }
}
</script>
